
//
//  wordController.m
//  tongxiangOASystem
//
//  Created by michael on 2017/6/26.
//  Copyright © 2017年 czd. All rights reserved.
//

#import "wordController.h"
#import <QuickLook/QuickLook.h>

@interface wordController ()<QLPreviewControllerDataSource>

@end

@implementation wordController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    
    [self configViews];
}

- (void)configViews{
    // 将QLPreviewControler  添加到本控制器上
    QLPreviewController *HPQLController = [[QLPreviewController alloc] init];
    HPQLController.dataSource = self;
    [self addChildViewController:HPQLController];
    [HPQLController didMoveToParentViewController:self];
    [self.view addSubview:HPQLController.view];
    HPQLController.view.frame = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height);
}

#pragma mark - QLPreviewControllerDataSource
- (NSInteger)numberOfPreviewItemsInPreviewController:(QLPreviewController *)controller{
    return 1;
}

-(id<QLPreviewItem>)previewController:(QLPreviewController *)controller previewItemAtIndex:(NSInteger)index {
    
    return [NSURL fileURLWithPath:self.attacmentURL];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
